package com.books.service.order.impl;

import com.books.mapper.order.OrderListMapper;
import com.books.model.entity.order.OrderList;
import com.books.service.order.IOrderListServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author ZhouRui
 * @title: 码上就来
 * @projectName cbstore-spring-boot
 * @description: TODO
 * @date 2021/10/1114:09
 */
@Service
@Transactional
public class OrderListServerImpl implements IOrderListServer {
    @Autowired(required = false)
    private OrderListMapper orderListMapper;

    @Autowired(required = false)
    private OrderList orderList;

    @Override
    public void addOrderlist(OrderList orderList) {
        orderListMapper.insert(orderList);
    }

    @Override
    public List<OrderList> findAllList(String buyId) {
        List<OrderList> orderLists = orderListMapper.findAllList(buyId);
        return orderLists;
    }

    @Override
    public void upStatusId(Integer buyEvaluate, String id) {
        orderListMapper.upStatusId (buyEvaluate,id);
    }

    @Override
    public void upStId(Integer buyStatus, String id) {
        orderListMapper.upStId (buyStatus,id);
    }

    @Override
    public List<OrderList> findByProductId(Integer productId) {
        List<OrderList> orderLists = orderListMapper.findByProductId(productId);
        return orderLists;
    }
}
